/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.manage.core.manage.convertor;

import info.peigen.hotpot.manage.core.domain.Relation;
import info.peigen.hotpot.manage.core.manage.form.RelationCreateForm;
import info.peigen.hotpot.manage.core.manage.form.RelationEditForm;
import info.peigen.hotpot.manage.core.manage.form.RelationSearchForm;
import info.peigen.hotpot.manage.core.repository.entity.RelationEntity;
import info.peigen.hotpot.manage.core.service.order.RelationCreateOrder;
import info.peigen.hotpot.manage.core.service.order.RelationEditOrder;
import info.peigen.hotpot.manage.core.service.result.info.RelationInfo;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <b>(RelationManageConvertor)</b>
 * 管理后台领域对象 "关联关系" 转换器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024-08-05
 */
@SuppressWarnings("unused")
@Mapper(builder = @Builder(disableBuilder = true))
public interface RelationManageConvertor {
    RelationManageConvertor INSTANCE = Mappers.getMapper(RelationManageConvertor.class);

    // ConvertToEntity
    RelationEntity convertToEntity(Relation domain);

    List<RelationEntity> convertToEntitiesByDomain(List<Relation> domains);

    RelationEntity convertToEntity(RelationInfo relationInfo);

    List<RelationEntity> convertToEntitiesByInfo(List<RelationInfo> relationInfo);

    RelationEntity convertToEntity(RelationSearchForm form);

    RelationEntity convertToEntity(RelationCreateForm form);

    RelationEntity convertToEntity(RelationEditForm form);

    // ConvertToDomain
    Relation convertToDomain(RelationEntity entity);

    List<Relation> convertToDomainsByEntity(List<RelationEntity> entities);

    Relation convertToDomain(RelationInfo relationInfo);

    List<Relation> convertToDomainsByInfo(List<RelationInfo> infos);

    Relation convertToDomain(RelationSearchForm form);

    Relation convertToDomain(RelationCreateForm form);

    Relation convertToDomain(RelationEditForm form);

    // ConvertToInfo
    RelationInfo convertToInfo(Relation domain);

    List<RelationInfo> convertToInfosByDomain(List<Relation> domains);

    RelationInfo convertToInfo(RelationEntity entity);

    List<RelationInfo> convertToInfosByEntity(List<RelationEntity> entities);

    RelationInfo convertToInfo(RelationSearchForm form);

    RelationInfo convertToInfo(RelationCreateForm form);

    RelationInfo convertToInfo(RelationEditForm form);

    // ConvertOrder
    RelationCreateOrder convertToCreateOrder(RelationCreateForm form);

    RelationEditOrder convertToEditOrder(RelationEditForm form);
}